import request from '@/utils/request.js'

// 发布活动
export function publishActivity(data, isPlatform) {
  return request({
    url: '/activity/publish',
    method: 'post',
    params: { isPlatform },
    data: data
  })
}

// 查看活动
export function readActivity(activityId, userId) {
  return request({
    url: '/activity/read',
    method: 'post',
    params: { activityId, userId }
  })
}

// 获取活动列表
export function getActivityList(query) {
  return request({
    url: '/activity/list',
    method: 'get',
    params: query
  })
}

// 获取活动详情
export function getActivityDetail(activityId) {
  return request({
    url: '/activity/detail',
    method: 'get',
    params: { activityId }
  })
}

// 更新活动状态
export function updateActivityStatus(activityId, status) {
  return request({
    url: '/activity/status',
    method: 'put',
    data: { activityId, status }
  })
}

// 删除活动
export function deleteActivity(activityId) {
  return request({
    url: '/activity/delete',
    method: 'delete',
    params: { activityId }
  })
} 